//--------------------------------------------------------------------------------------------------------------------
// check or in-check the 'email me' check box 
function checkSendEmailBox(check)
{
    if( check )
    {
        document.getElementById('id_check_send_email').checked = true;
    }
    else
    {
        document.getElementById('id_check_send_email').checked = false;
    }
};

//--------------------------------------------------------------------------------------------------------------------
// allow the user tomodify his "sendMeEmail" field
function setSendEmail()
{
    var args = { 
           type: "POST", 
           url: "/settings/setSendEmail/",
           cache: false,
           data: { 'check_send_email' : document.getElementById('id_check_send_email').checked }, 
           complete:function(res)  { checkSendEmailBox( document.getElementById('id_check_send_email').checked ); },
           error: function(errorThrown)  { document.write(errorThrown.responseText);  }
           };
    $.ajax(args);
    return false;  
};

